/*
与后台交互模块 （依赖已封装的ajax函数）
 */
import ajax from './ajax'
// 转成生产环境时增加
// const BASE_URL = 'http://127.0.0.1:8000'
// 转成对外服务生产环境时增加
const BASE_URL = 'http://10.24.0.77:8000'
// const BASE_URL = 'https://www.easy-mock.com/mock/5be3cc7af4410b7e6ee7ce6f/example'
// 开发环境中使用以下配置
// const BASE_URL = '/api'
/**
 * 测试接口
 */
export const reqlogin = ({ username, password }) => ajax(BASE_URL + '/user/login', { username, password }, 'POST')

export const reqgoods = ({ goodsid, goodstype }) => ajax(BASE_URL + '/kfreport/list_goodsid', { goodsid, goodstype })

export const reqsugoods = ({ goodsid }) => ajax(BASE_URL + '/kfreport/get_good_su', { goodsid })

export const reqsagoods = ({ goodsid }) => ajax(BASE_URL + '/kfreport/get_goods_sa_t', { goodsid })

export const reqstockgoods = ({ goodsid }) => ajax(BASE_URL + '/kfreport/get_goodsqty_lst', { goodsid })

export const reqpricegoods = ({ goodsid }) => ajax(BASE_URL + '/kfreport/get_good_price', { goodsid })

export const reqwebjob = () => ajax(BASE_URL + '/kfreport/get_webjob_v')

export const reqmonthorders = ({ reqyear, reqmonth }) => ajax(BASE_URL + '/kfreport/get_mouth_orders_v', { reqyear, reqmonth})
// ({latitude, longitude}) => ajax(BASE_URL + '/shops', {latitude, longitude})